﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using DreamBuilder.Common;
using DreamBuilder.Core.DAO;



namespace DreamBuilder.UI.UserControls.DataAccess
{
    public abstract class UserControlsDataAccessBase
    {
        private IDBHelper dbHelper;
        public IDBHelper DBHelper
        {
            get
            {
                if (dbHelper == null)
                {
                    EPPage page = HttpContext.Current.Handler as EPPage;
                    if (page != null && !string.IsNullOrEmpty(page.DBHelpName))
                    {
                        dbHelper = DBHelperFactory.CreateInstance(page.DBHelpName);
                    }
                }
                return dbHelper;
            }
            set
            {
                dbHelper = value;
            }
        }

    }
}
